import { createRouter, createWebHistory } from 'vue-router'
import Step01 from '../views/01.认识pinia.vue'
import Step02 from '../views/02.定义store(选项式).vue'
import Step03 from '../views/03.state(选项式).vue'
import Step04 from '../views/04.getters(选项式).vue'
import Step05 from '../views/05.actions(选项式).vue'
import Step02c from '../views/02.定义store(组合式).vue'
import Step03c from '../views/03.state(组合式).vue'
import Step04c from '../views/04.getters(组合式).vue'
import Step05c from '../views/05.actions(组合式).vue'
import Step06 from '../views/06.axios(选项式).vue'
import Step07 from '../views/07.综合案例.vue'
import AxiosTutorial from '../views/07.axios-tutorial.vue'
import AxiosGuide from '../views/axios-guide.vue'

const routes = [
  {
    path: '/',
    redirect: '/01'
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/01',
    name: 'step01',
    component: Step01
  },
  {
    path: '/02',
    name: 'step02',
    component: Step02
  },
  {
    path: '/03',
    name: 'step03',
    component: Step03
  },
  {
    path: '/04',
    name: 'step04',
    component: Step04
  },
  {
    path: '/05',
    name: 'step05',
    component: Step05
  },
  {
    path: '/02c',
    name: 'step02c',
    component: Step02c
  },
  {
    path: '/03c',
    name: 'step03c',
    component: Step03c
  },
  {
    path: '/04c',
    name: 'step04c',
    component: Step04c
  },
  {
    path: '/05c',
    name: 'step05c',
    component: Step05c
  },
  {
    path: '/06',
    name: 'step06',
    component: Step06
  },
  {
    path: '/07',
    name: 'step07',
    component: Step07
  },
  {
    path: '/axios-tutorial',
    name: 'AxiosTutorial',
    component: AxiosTutorial
  },
  {
    path: '/axios-guide',
    name: 'AxiosGuide',
    component: AxiosGuide
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router
